<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>视频播放(m3u8视频)</title>
<link rel="stylesheet" type="text/css" href="../../../kuoqi-ui/web.dev.css"/>
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
<script type="text/javascript" src="../../kq.dev.js"></script>
<script type="text/javascript" src="hls.min.js"></script>

<style>
#box{
	position:relative;	
}
</style>
</head>

<body>
<div id="box"><video controls="controls" id="video"></video></div>
</body>
<script type="text/javascript" src="kq.video.js?v=108"></script>
<script>
var video = new $Q.plugIn.video({
 	box:'#box',
});
video.preload('/upload/test/index.m3u8');//预加载一个视频信息
video.onPlay = function(){
	console.log(222);	
}
video.onEnd = function(){
	console.log(43333333);	
}
// //获取视频连接地址
// video.preload('http://debug.kuoqi.com/upload/test/index.m3u8');//预加载一个视频信息
//video.preload();

	//
 //  if(Hls.isSupported()) {
 //    var hls = new Hls();
 //    hls.loadSource('/upload/test/index.m3u8');
 //    hls.attachMedia(video);
 //    hls.on(Hls.Events.MANIFEST_PARSED,function() {
 //      //video.play();
 //  });
 // }
 // // hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
 // // When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element throught the `src` property.
 // // This is using the built-in support of the plain video element, without using hls.js.
 // // Note: it would be more normal to wait on the 'canplay' event below however on Safari (where you are most likely to find built-in HLS support) the video.src URL must be on the user-driven
 // // white-list before a 'canplay' event will be emitted; the last video event that can be reliably listened-for when the URL is not on the white-list is 'loadedmetadata'.
 //  else if (video.canPlayType('application/vnd.apple.mpegurl')) {
 //    video.src = '/upload/test/index.m3u8';
	// $Q.alert("222");
 //    video.addEventListener('loadedmetadata',function() {
 //      //video.play();
 //    });
 //  }

//var v = new $Q.plugIn.video({
//	box:'#box',
//});



//video.preload('./demo/test.mp4',function(){
//	//预加载完成执行	
//	vodeo.play();//预加载完成执行播放
//});
</script>
</html>
